<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
%>
<html lang="zh-cn">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no, email=no" />
<title>登录</title>
<link rel="stylesheet" href="<%=path %>/admin/css/pintuer.css">
<link rel="stylesheet" href="<%=path %>/admin/css/admin.css">
<script type="text/javascript"> var paths = '<%=path%>'; </script>
<script src="<%=path %>/admin/js/jquery.js"></script>
<script src="<%=path %>/admin/js/pintuer.js"></script>
<script src="<%=path %>/admin/js/pic.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/lrz.bundle.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/lrz.all.bundle.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/1.chunk.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/2.chunk.js"></script>
<script type="text/javascript" src="<%=path %>/admin/js/admin.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/layer/layer.js" ></script>
</head>
<body>
	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>配置管理</strong>
		</div>
		<div class="body-content">
			<form id="planForm" method="post" class="form-x" action="<%=path %>/dictionary/save">
			<input type="hidden" value="${entity.id}" name="id" id="id"/>
			   <c:forEach items="${list}" var="item" varStatus="vs"> 
				<div class="form-group">
					<div class="label">
						<label>${item.name}</label>
					</div>
					<div class="field">
						<input type="text" class="input w50 clear" value="${item.value}" 
						code="${item.code}" id="value" oninput="update(this)"/>
					</div>
				</div> 
			</c:forEach>
                </div>
				</div>
			</form>
		</div>
	</div>
</body>
<script type="text/javascript" src="<%=path%>/admin/js/layer/layer.js" ></script>
<script type="text/javascript"> 
	function update(obj){
		var re = /^[0-9]+.?[0-9]*$/; 
		var code=$(obj).attr("code");
		var value=$(obj).val();
		if(value==""){
			layer.msg("请输入数值");
		}else if(!re.test(value)){
			$(obj).val("");
		}else{
			$.ajax({
	            url : paths + "/dictionary/save",
	            type : "POST",
	            dataType : "json",
	            data : {
	                "code" : code,
	                "value" : value
	            },
	            success : function(data) {
	                
	            },
	            error : function(r, s, m) {
	            }
	        });
		}
		
	};
</script>
</html>